package com.rc.pojo.po;

import com.mybatisflex.annotation.Column;
import com.mybatisflex.annotation.Id;
import com.mybatisflex.annotation.KeyType;
import com.mybatisflex.annotation.Table;
import com.rc.common.model.BaseUserEntity;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serial;
import java.io.Serializable;
import java.time.LocalDateTime;

/**
 *  实体类。
 *
 * @author 27806
 * @since 2024-06-15
 */
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
@Table(value = "area", schema = "rc")
public class Area implements BaseUserEntity, Serializable {

    @Serial
    private static final long serialVersionUID = 1L;

    /**
     * 园区id
     */
    @Id(keyType = KeyType.Auto)
    private Long id;

    /**
     * 园区名称
     */
    private String name;

    /**
     * 封面url
     */
    private String cover;

    /**
     * 简介
     */
    private String description;

    private String address;

    /**
     * 园区大小单位m2
     */
    private Double size;

    private Double lng;

    private Double lat;

    /**
     * 种植植物
     */
    private Long plantId;

    @Column(tenantId = true)
    private Long farmId;

    /**
     * 创建时间
     */
    @Column(onInsertValue = "now()")
    private LocalDateTime createTime;

    /**
     * 更新时间
     */
    @Column(onUpdateValue = "now()",onInsertValue = "now()")
    private LocalDateTime updateTime;

    private Long createUser;
    private Long updateUser;
}
